<?xml version="1.0" encoding="ISO-8859-1" ?>

<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:rich="http://richfaces.org/rich"
	  xmlns:a4j="http://richfaces.org/a4j">

	<body>
	
		<ui:composition template="../templates/template.xhtml">
		
			<ui:define name="title">#{bundle.pais_titulo_consultar}</ui:define>

			<ui:define name="content">
				
				<rich:panel>
					<f:facet name="header">#{bundle.pais_titulo_consultar}</f:facet>
					<a4j:form id="formPaisConsulta">
						
						<a4j:commandButton action="#{paisBackBean.obterListaPais}" value="#{bundle.pais_btn_consultar}" reRender="gridPais" />
						
						<div class="linha"/>
						
						<rich:datascroller for="gridPais" maxPages="10"/>
						<rich:dataTable value="#{paisBackBean.paisFormBean.listaPais}" var="pais" id="gridPais" rows="10" align="center" width="100%">
							<rich:column filterBy="#{pais.codigo}">
								<f:facet name="header">
									<h:outputText value="#{bundle.pais_codigo}"/>
								</f:facet>
								<h:outputText value="#{pais.codigo}"/>
							</rich:column>
							<rich:column filterBy="#{pais.descricao}">
								<f:facet name="header">
									<h:outputText value="#{bundle.pais_descricao}"/>
								</f:facet>
								<h:outputText value="#{pais.descricao}"/>
							</rich:column>
							<rich:column filterBy="#{pais.ddi}">
								<f:facet name="header">
									<h:outputText value="#{bundle.pais_ddi}"/>
								</f:facet>
								<h:outputText value="#{pais.ddi}"/>
							</rich:column>
							<rich:column filterBy="#{pais.dataCriacao}">
								<f:facet name="header">
									<h:outputText value="#{bundle.pais_data_criacao}"/>
								</f:facet>
								<h:outputText value="#{pais.dataCriacao}">
									<f:convertDateTime pattern="dd/MM/yyyy, HH:mm" timeZone="America/Sao_Paulo" />
								</h:outputText>
							</rich:column>
							<rich:column filterBy="#{pais.dataAlteracao}">
								<f:facet name="header">
									<h:outputText value="#{bundle.pais_data_alteracao}"/>
								</f:facet>
								<h:outputText value="#{pais.dataAlteracao}">
									<f:convertDateTime pattern="dd/MM/yyyy, HH:mm" timeZone="America/Sao_Paulo" />
								</h:outputText>
							</rich:column>
							<rich:column>
								<a4j:commandButton id="btnEditar" actionListener="#{paisBackBean.listenerIrEditarPais}" value="#{bundle.pais_btn_editar}" reRender="formPaisManter">
									<f:param id="codigoPaisEditar" name="codigoPaisEditar" value="#{pais.codigo}" />
									<rich:componentControl for="manterPais" attachTo="btnEditar" operation="show" event="onclick" />
								</a4j:commandButton>
							</rich:column>
							<rich:column>
								<a4j:commandButton id="btnExcluir" actionListener="#{paisBackBean.listenerIrExcluirPais}" value="#{bundle.pais_btn_excluir}" reRender="formPaisManter">
									<f:param id="codigoPaisExcluir" name="codigoPaisExcluir" value="#{pais.codigo}" />
									<rich:componentControl for="manterPais" attachTo="btnExcluir" operation="show" event="onclick" />
								</a4j:commandButton>
							</rich:column>
						</rich:dataTable>
						
						<div class="linha"/>
						
						<a4j:commandButton value="#{bundle.pais_btn_novo}" actionListener="#{paisBackBean.listenerIrInserirPais}" id="btnNovo" reRender="formPaisManter">
							<rich:componentControl for="manterPais" attachTo="btnNovo" operation="show" event="onclick" />
						</a4j:commandButton>
						
					</a4j:form>
				</rich:panel>
				
				<ui:include src="/pages/pais/manterPais.xhtml" />
				
			</ui:define>
			
		</ui:composition>
		
	</body>

</html>